import { toRaw } from 'vue';
import { create_static_focusDisplay_mana } from '../../../../../components/globalComps/comps/focusDisplay';
import { id_split } from '../../../DataDefine/sourceData';
import { normalizeContainer } from '../../../Func';
import {
  select_node_border_id,
  select_node_content_id,
  select_node_content_uni_items_border_id,
  select_node_content_uni_items_conform_id,
  select_node_quick_func_border_id,
  select_node_quick_func_restart_select_id,
  select_node_quick_func_select_all_id,
  select_node_view_selected_id,
  spacename_select_node,
} from '../DataDefine/sourceData';

const select_node_staticNodeTag = 'select_node_staticNode';

/**
 * 浮动元素 全局管理集 目标注册
 */
let focusDisplay_spacename = create_static_focusDisplay_mana(
  spacename_select_node
);

class select_node_staticNode {
  get [Symbol.toStringTag]() {
    return select_node_staticNodeTag;
  }

  constructor(props) {
    this.props = toRaw(props);

    this.select_node_border_dom = normalizeContainer(
      this.#fill_id(select_node_border_id)
    );

    this.select_node_content_dom = normalizeContainer(
      this.#fill_id(select_node_content_id)
    );

    this.select_node_view_selected_dom = normalizeContainer(
      this.#fill_id(select_node_view_selected_id)
    );

    this.select_node_content_uni_items_border_dom = normalizeContainer(
      this.#fill_id(select_node_content_uni_items_border_id)
    );

    this.select_node_content_btn_dom = normalizeContainer(
      this.#fill_id(select_node_content_uni_items_conform_id)
    );

    this.select_node_quick_func_select_all_node = normalizeContainer(
      this.#fill_id(select_node_quick_func_select_all_id)
    );

    this.select_node_quick_func_restart_select_node = normalizeContainer(
      this.#fill_id(select_node_quick_func_restart_select_id)
    );

    this.select_node_quick_func_border_node = normalizeContainer(
      this.#fill_id(select_node_quick_func_border_id)
    );

    /**
     * 浮动元素 operate
     */
    let focusDisplay_op = focusDisplay_spacename.create_new_focusDisplay_dom();

    this.focusDisplay_el = focusDisplay_op.targetEl;

    this.focusDisplay_el_container = this.focusDisplay_el.firstChild;
  }

  props;

  /**
   * 选择 主体
   * @type {HTMLElement}
   */
  select_node_border_dom;

  /**
   * 显示 栏
   * @type {HTMLElement}
   */
  select_node_view_selected_dom;

  /**
   * 内容 容器
   * @type {HTMLElement}
   */
  select_node_content_dom;

  /**
   * 浮动元素
   * @type {HTMLDialogElement}
   */
  focusDisplay_el;

  /**
   * 浮动元素 容器
   * @type {HTMLElement}
   */
  focusDisplay_el_container;

  /**
   * uni 元素 容器
   * @type {HTMLElement}
   */
  select_node_content_uni_items_border_dom;

  /**
   * uni 选择 确认
   * @type {HTMLButtonElement}
   */
  select_node_content_btn_dom;

  /**
   * 快速 函数 全选
   * @type {HTMLElement}
   */
  select_node_quick_func_select_all_node;

  /**
   * 快速 函数 全不选
   * @type {HTMLElement}
   */
  select_node_quick_func_restart_select_node;

  /**
   * 快速 函数 主体
   * @type {HTMLElement}
   */
  select_node_quick_func_border_node;

  #fill_id(prefix_cla) {
    return prefix_cla + id_split + this.props.id;
  }
}

export { select_node_staticNode };
